08. Mini Project 2

Instructions

In the following mini project, you'll convert the inputs and outputs of the dataset into numbers. Namely, you will convert each review string into a vector, and each label into a 0 or 1. You’ll need to make a few additions to the notebook, but the main work will be implementing two functions, whose signatures are shown below:

def update_input_layer(review):
    """ Modify the global layer_0 to represent the vector form of review.
    The element at a given index of layer_0 should represent \
    how many times the given word occurs in the review.
    Args:
        review(string) - the string of the review
    Returns:
        None
    """
    global layer_0
    # clear out previous state, reset the layer to be all 0s
    layer_0 *= 0
    ## Your code here
    pass
def get_target_for_label(label):
    """Convert a label to `0` or `1`.
    Args:
        label(string) - Either "POSITIVE" or "NEGATIVE".
    Returns:
        `0` or `1`.
    """
    pass

Mini Project 2

Task List:

Task Feedback:

Nice work! In the next video, Andrew will share his solution.